﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

using CSF.Customers.Data;
using CSF.Customers.BLL;
using CSF.Customers.Service;

namespace CSF.Service.Accounts
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码、svc 和配置文件中的类名“CustomerUserApplySvc”。
    public class CustomerUserApplySvc : ICustomerUserApplySvc
    {

        #region ICustomerUserApplySvc 成员

        public List<CustomerUserApply> GetByApprovalStatus(ApprovalStatus status)
        {
            CustomerUserApplyBLL bll = new CustomerUserApplyBLL();
            return bll.GetByApprovalStatus(status);
        }

        public bool Approve(int id, int customerId, string approveComment, string approveBy)
        {
            CustomerUserApplyBLL bll = new CustomerUserApplyBLL();
            return bll.Approve(id, customerId, approveComment, approveBy);
        }

        public bool Disapprove(int id, string approveComment, string approveBy)
        {
            CustomerUserApplyBLL bll = new CustomerUserApplyBLL();
            return bll.Disapprove(id, approveComment, approveBy);
        }

        #endregion

        #region IDataIdKeyService<CustomerUserApply> 成员

        public CustomerUserApply GetOneById(int id)
        {
            CustomerUserApplyBLL bll = new CustomerUserApplyBLL();
            return bll.GetOneById(id);
        }

        public bool UpdateById(CustomerUserApply t, int id)
        {
            CustomerUserApplyBLL bll = new CustomerUserApplyBLL();
            return bll.UpdateById(t, id);
        }

        public bool DeleteOneById(int id)
        {
            CustomerUserApplyBLL bll = new CustomerUserApplyBLL();
            return bll.DeleteOneById(id);
        }

        public int DeleteById(IEnumerable<int> ids)
        {
            CustomerUserApplyBLL bll = new CustomerUserApplyBLL();
            return bll.DeleteById(ids);
        }

        #endregion

        #region IDataEntityService<CustomerUserApply> 成员

        public List<CustomerUserApply> GetAll()
        {
            CustomerUserApplyBLL bll = new CustomerUserApplyBLL();
            return bll.GetAll();
        }

        public int Insert(CustomerUserApply entity)
        {
            CustomerUserApplyBLL bll = new CustomerUserApplyBLL();
             bll.Insert(entity);
             return entity.Id;
        }

        #endregion
    }
}
